package com.cssy.xxkj.logic.dao.impl;

import java.util.List;

import org.springframework.dao.DataAccessException;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.cssy.xxkj.logic.dao.LogicExcelToStoreDAO;
import com.cssy.xxkj.logic.entity.LogicExcelToStoreDO;
import com.plat.exception.SyBaseException;
import com.plat.helper.SearchConditions;

/**
 * 锟斤拷莘锟斤拷识锟斤拷锟绞碉拷锟斤拷锟�
 * @since 2014-12-09
 */
public class LogicExcelToStoreDAOImpl extends SqlMapClientDaoSupport implements LogicExcelToStoreDAO {

    /**
     * 锟斤拷锟斤拷锟斤拷锟�
     * @param logicExcelToStoreDO
     * @return 锟斤拷锟斤拷锟斤拷莸锟斤拷锟斤拷锟�
     */
    public String insertLogicExcelToStoreDO(LogicExcelToStoreDO logicExcelToStoreDO) throws DataAccessException {
        Object id = getSqlMapClientTemplate().insert("LogicExcelToStore.insert", logicExcelToStoreDO);
        return (String) id;
    }

    /**
     * 统锟狡硷拷录锟斤拷
     * @param logicExcelToStoreDO
     * @return 锟斤拷锟斤拷募锟铰硷拷锟�
     */
    public Integer countLogicExcelToStoreDOByExample(LogicExcelToStoreDO logicExcelToStoreDO) throws DataAccessException {
        Integer count = (Integer) getSqlMapClientTemplate().queryForObject("LogicExcelToStore.countByDOExample", logicExcelToStoreDO);
        return count;
    }

    /**
     * 锟斤拷锟铰硷拷录
     * @param logicExcelToStoreDO
     * @return 锟斤拷影锟斤拷锟斤拷锟斤拷锟�
     */
    public Integer updateLogicExcelToStoreDO(LogicExcelToStoreDO logicExcelToStoreDO) throws DataAccessException {
        int result = getSqlMapClientTemplate().update("LogicExcelToStore.update", logicExcelToStoreDO);
        return result;
    }

    /**
     * 锟斤拷取锟斤拷锟斤拷锟叫憋拷
     * @param logicExcelToStoreDO
     * @return 锟斤拷锟斤拷锟叫憋拷
     */
    @SuppressWarnings("unchecked")
    public List<LogicExcelToStoreDO> findListByExample(LogicExcelToStoreDO logicExcelToStoreDO) throws DataAccessException {
        List<LogicExcelToStoreDO> list = getSqlMapClientTemplate().queryForList("LogicExcelToStore.findListByDO", logicExcelToStoreDO);
        return list;
    }

    /**
     * 锟斤拷锟斤拷锟斤拷锟斤拷取logicExcelToStoreDO
     * @param id
     * @return logicExcelToStoreDO
     */
    public LogicExcelToStoreDO findLogicExcelToStoreDOByPrimaryKey(String id) throws DataAccessException {
        LogicExcelToStoreDO logicExcelToStoreDO = (LogicExcelToStoreDO) getSqlMapClientTemplate().queryForObject("LogicExcelToStore.findByPrimaryKey", id);
        return logicExcelToStoreDO;
    }

    /**
     * 删锟斤拷锟铰�
     * @param id
     * @return 锟斤拷影锟斤拷锟斤拷锟斤拷锟�
     */
    public Integer deleteLogicExcelToStoreDOByPrimaryKey(String id) throws DataAccessException {
        Integer rows = (Integer) getSqlMapClientTemplate().delete("LogicExcelToStore.deleteByPrimaryKey", id);
        return rows;
    }

	@Override
	public List<LogicExcelToStoreDO> find(SearchConditions scs)
			throws DataAccessException {
		return getSqlMapClientTemplate().queryForList("LogicExcelToStore_ex.find",scs);
	}

	@Override
	public Integer count(SearchConditions scs) throws DataAccessException {
		return (Integer) getSqlMapClientTemplate().queryForObject( "LogicExcelToStore_ex.count", scs);
	}

	@Override
	public Integer deleteBizRemoved(String id) throws DataAccessException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void deleteLogicExcelToStoreByMonth(SearchConditions scs)
			throws SyBaseException {
		getSqlMapClientTemplate().delete("LogicExcelToStore_ex.deleteByMonth", scs);
		
	}

}